package com.study.edoc.dao;

import com.study.edoc.pojo.UserInfo;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.Map;

public interface UserInfoMapper {

    int deleteById(Integer id);

    int insert(UserInfo userInfo);

    int dynamicInsert(UserInfo userInfo);

    UserInfo selectById(Integer id);

    int dynamicUpdate(UserInfo userInfo);

    int updateById(UserInfo userInfo);

    @Update("update userinfo set deleted=1 where id=#{id}")
    int deleteLogic(int id);

    @Select("select * from userinfo where ${key}=#{value} and deleted=0")
    UserInfo selectByMap(Map<String,Object> paramMap);


    //int updateFields(Map<String, Object> fieldMap);
}
